#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "scanthread.h"
#include <QTime>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    int totTask;
    int finTask;
    QStringList openedPort;
    Ui::MainWindow *ui;
    ScanThread* threadPool[64];
    bool isOver;
    QTime startTime, endTime;
    void* scan_some_port(void *arg);
    void showAllOpenedPorts();

public slots :
    void scan();
    void terminateScan();
    void updateResult(QString info, bool open);

};
#endif // MAINWINDOW_H
